package com.project.user.controller;

import com.project.user.entity.entitly.UserPhoneCode;

import java.util.Map;

public interface UserCodeController {
    /**
     * set a new phoneCode
     *
     * @param phone user Phone
     * @return new PhoneCode
     * @throws Exception SqlExample
     */
    int setUserPhoneCode(String phone) throws Exception;

    /**
     * Mobile phone verification code passed verification and return UserPhoneCode object
     *
     * @param phone     phone
     * @param phoneCode phoneCode
     * @return is-successfully:Mobile phone verification code passed verification; is-object:UserPhoneCode object
     * @throws Exception SqlExample Notfound PhoneNumber
     */
    Map<String, Object> getUserPhoneCode(String phone, String phoneCode) throws Exception;

    /**
     * return Mobile phone verification code passed verification object
     *
     * @param phone     phone
     * @param phoneCode phone code
     * @return Mobile phone verification code passed verification object
     * @throws Exception sqlExample the phone code is not found
     */
    UserPhoneCode userPhoneCode(String phone, String phoneCode) throws Exception;
}
